<!DOCTYPE html>
<html>
    <head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title><{$system_name}>- 登录</title>
	<meta name="keywords" content="">
	<meta name="description" content="">
	<link rel="shortcut icon" href="__PUBLIC__/favicon.ico">
	<link href="__PUBLIC__/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
	<link href="__PUBLIC__/css/font-awesome.css?v=4.4.0" rel="stylesheet">
	<link href="__PUBLIC__/css/plugins/iCheck/custom.css" rel="stylesheet">
	<link href="__PUBLIC__/css/animate.css" rel="stylesheet">
	<link href="__PUBLIC__/css/style.css?v=4.1.0" rel="stylesheet">
	<!--[if lt IE 9]>
	<meta http-equiv="refresh" content="0;ie.html" />
	<![endif]-->
	<script>if (window.top !== window.self) {
		window.top.location = window.location;
	    }</script>
    </head>
    <body class="gray-bg">
	<div class="middle-box text-center loginscreen  animated fadeInDown">
	    <div>
		<div>
		    <h1 class="logo-name" style="font-size: 115px;"><{$system_code}></h1>
		</div>
		<h3>欢迎使用 <{$system_name}></h3>
		<form method="post" onsubmit="return false">
		    <div class="form-group">
			<input type="text" id="txtusername" class="form-control" placeholder="用户名/手机号码" required="">
		    </div>
		    <div class="form-group">
			<input type="password"  id="txtpassword"  class="form-control" placeholder="密码" required="">
		    </div>
<!--		    <div class="form-group text-right">
			<div class="checkbox i-checks">
			    <label class="no-padding">
				<div class="icheckbox_square-green" style="position: relative;"><input type="checkbox" id="ckblogintype" name="ckblogintype" value="1" style="position: absolute; opacity: 0;"></div><i></i> 代理商</label>
			</div>
		    </div>-->
		    <button type="button" id="btnlogin" class="btn btn-primary block full-width m-b">登录</button>
		</form>
	    </div>
	</div>
	<!-- 全局js -->
	<script src="__PUBLIC__/js/jquery.min.js?v=2.1.4"></script>
	<script src="__PUBLIC__/js/bootstrap.min.js?v=3.3.6"></script>
	<script src="__PUBLIC__/js/plugins/layer/layer.min.js"></script>
	<!-- iCheck -->
	<script src="__PUBLIC__/js/plugins/iCheck/icheck.min.js"></script>
	<script>
		    $(document).ready(function () {
			$('.i-checks').iCheck({
			    checkboxClass: 'icheckbox_square-green',
			    radioClass: 'iradio_square-green',
			});
		    });
	</script>
	<script>
	    var index = "<{:U('./index','','shtml')}>";
	    var loginsubmit = "<{:U('loginsubmit','','shtml')}>";
	    $('#btnlogin').click(function () {
		//加载loading层
		var loading = layer.load(1, {
		    shade: [0.1, '#fff'] //0.1透明度的白色背景
		});
		var username = $("#txtusername").val();
		var password = $("#txtpassword").val();
		var login_type = $("#ckblogintype").prop('checked') ? '2' : '1';
		login_type = '1';
		if (username == "")
		{
		    layer.close(loading);
		    layer.alert("账号不能为空！\r\n", {
			title: '提示框',
			icon: 0,
		    });
		    return false;
		}
		if (password == "")
		{
		    layer.close(loading);
		    layer.alert("密码不能为空！\r\n", {
			title: '提示框',
			icon: 0,
		    });
		    return false;
		}
		$.post(loginsubmit, {'username': username, 'password': password, 'type': login_type},
			function (data) {
			    if (data.ret == '1001') {
				layer.msg(data.code, {icon: 6, time: 1000});
				location.href = index;
				layer.close(loading);
			    } else {
				layer.msg(data.code, {icon: 5, time: 1000});
				layer.close(loading);
			    }
			}, 'json');
	    });
	</script>
    </body>
</html>
